# Java Objects

This folder contains:

This folder contains:

- CASA_RA.class,
- CASA_RA.java,
- CASA_RA$particle.class

In order to generate the coordinate and motility parameter text files from your own data, install ImageJ. 

Then, paste CASA_RA.class, CASA_RA.java, CASA_RA$particle.class in the "plug-in" folder.

Lastly, compile and run CASA_RA to generate the results file and save it as text file.

---

## Dependencies

You will require:

- ImageJ bundled with Java 1.8.0_172 or later

---

## Contacts

|Name                             |Email Address           |
|---------------------------------|------------------------|
|Eder Alejandro Rodríguez Martínez|eder_rdz_mtz@hotmail.com|
|Andrés Aragón Martínez           |armandres@gmail.com.    |


Brief instructions for analysis with ImageJ CASA_RA plugin
The following instructions are those included in Giaretta et al., (2017) with light modifications.

Plugin installation 
We report the original instruction from Wilson Leedy and Ingermann
“The plugin must first be downloaded to the computer’s plugins folder and compiled (Plugins->Compile and Run, locate the file and open, see http://rsb.info.nih.gov/ij/docs/menus/plugins.html for more detailed instruction). Running the plugin will result in initiation of a dialog box where parameters for analysis may be entered (and must be entered for each analysis performed - we recommend use of a macro to input these values, macros can then be saved with particular settings for a specific species). Macros can be recorded by opening the macro recorder (Plugins->Macros->Record), and performing the analysis as normal.Clicking Create will open a new window with the text of the macro, running this macro will open the plugin, input the previously used values, and run the plugin. See http://rsb.info.nih.gov/ij/docs/menus/plugins.html#macros and http://rsb.info.nih.gov/ij/developer/macro/macros.html#recorder for more detailed instructions regarding macro recording.”

Import a video in Image J and analysis

After saving videos of sperm samples, these should be converted in .avi format.
To import the video into Image J after launching the software, choose File>Import>Avi…  and chose the file from the correct folder. The plugin also accepts sequence of images File>Import>Image sequence…
A dialog box opens and it should be indicated to import fames from 60 to 120 and to convert the image to greyscale.
The video opens and the threshold should then be adjusted. Use Image->Adjust->Threshold file menu. Adjust the sliders to select spermatozoa red) and avoid selecting any background image (the background should be white). By clicking “Apply” the image is converted into black and white (black spermatozoa and white background).
Launch the plugin and fill each field with the appropriate values (for stallion Giaretta et al., 2017 and for boar see the main article) or alternatively create and run a specific Macro.

Giaretta E, Munerato M, Yeste M, Galeati G, Spinaci M, Tamanini C, Mari G and Bucci D (2017) Implementing an open-access CASA software for the assessment of stallion sperm motility: Relationship with other sperm quality parameters. Animal Reproduction Science 176 11–19.

